.class public Lcom/brixd/niceapp/util/CommunityDetailRequestCache;
.super Ljava/lang/Object;
.source "CommunityDetailRequestCache.java"


# instance fields
.field private mAppModelCaches:Landroid/util/SparseArray;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Landroid/util/SparseArray",
            "<",
            "Ljava/lang/ref/SoftReference",
            "<",
            "Lcom/brixd/niceapp/community/model/CommunityAppModel;",
            ">;>;"
        }
    .end annotation
.end field

.field private mContext:Landroid/content/Context;

.field private mProgressHUD:Lcom/zuiapps/suite/utils/hud/ProgressHUD;

.field private mRequest:Lcom/brixd/niceapp/service/restful/NiceAppRestfulRequest;

.field private mScrollToComment:Z

.field private mScrollToUpUsers:Z


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .registers 4
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    const/4 v1, 0x0

    .line 33
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 24
    new-instance v0, Landroid/util/SparseArray;

    invoke-direct {v0}, Landroid/util/SparseArray;-><init>()V

    iput-object v0, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mAppModelCaches:Landroid/util/SparseArray;

    .line 30
    iput-boolean v1, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mScrollToUpUsers:Z

    .line 31
    iput-boolean v1, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mScrollToComment:Z

    .line 34
    iput-object p1, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mContext:Landroid/content/Context;

    .line 35
    iget-object v0, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/brixd/niceapp/service/adapter/ReqRestAdapter;->niceAppAdapter(Landroid/content/Context;)Lretrofit/RestAdapter;

    move-result-object v0

    const-class v1, Lcom/brixd/niceapp/service/restful/NiceAppRestfulRequest;

    invoke-virtual {v0, v1}, Lretrofit/RestAdapter;->create(Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/brixd/niceapp/service/restful/NiceAppRestfulRequest;

    iput-object v0, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mRequest:Lcom/brixd/niceapp/service/restful/NiceAppRestfulRequest;

    .line 36
    return-void
.end method

.method static synthetic access$000(Lcom/brixd/niceapp/util/CommunityDetailRequestCache;)Landroid/util/SparseArray;
    .registers 2
    .param p0, "x0"    # Lcom/brixd/niceapp/util/CommunityDetailRequestCache;

    .prologue
    .line 22
    iget-object v0, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mAppModelCaches:Landroid/util/SparseArray;

    return-object v0
.end method

.method static synthetic access$100(Lcom/brixd/niceapp/util/CommunityDetailRequestCache;)Landroid/content/Context;
    .registers 2
    .param p0, "x0"    # Lcom/brixd/niceapp/util/CommunityDetailRequestCache;

    .prologue
    .line 22
    iget-object v0, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mContext:Landroid/content/Context;

    return-object v0
.end method

.method static synthetic access$200(Lcom/brixd/niceapp/util/CommunityDetailRequestCache;)Z
    .registers 2
    .param p0, "x0"    # Lcom/brixd/niceapp/util/CommunityDetailRequestCache;

    .prologue
    .line 22
    iget-boolean v0, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mScrollToUpUsers:Z

    return v0
.end method

.method static synthetic access$300(Lcom/brixd/niceapp/util/CommunityDetailRequestCache;)Z
    .registers 2
    .param p0, "x0"    # Lcom/brixd/niceapp/util/CommunityDetailRequestCache;

    .prologue
    .line 22
    iget-boolean v0, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mScrollToComment:Z

    return v0
.end method

.method static synthetic access$400(Lcom/brixd/niceapp/util/CommunityDetailRequestCache;)Lcom/zuiapps/suite/utils/hud/ProgressHUD;
    .registers 2
    .param p0, "x0"    # Lcom/brixd/niceapp/util/CommunityDetailRequestCache;

    .prologue
    .line 22
    iget-object v0, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mProgressHUD:Lcom/zuiapps/suite/utils/hud/ProgressHUD;

    return-object v0
.end method


# virtual methods
.method public gotoDetail(I)V
    .registers 10
    .param p1, "appId"    # I

    .prologue
    .line 53
    iget-object v3, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mAppModelCaches:Landroid/util/SparseArray;

    invoke-virtual {v3, p1}, Landroid/util/SparseArray;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/ref/SoftReference;

    .line 54
    .local v0, "cache":Ljava/lang/ref/SoftReference;, "Ljava/lang/ref/SoftReference<Lcom/brixd/niceapp/community/model/CommunityAppModel;>;"
    if-eqz v0, :cond_38

    .line 55
    invoke-virtual {v0}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/brixd/niceapp/community/model/CommunityAppModel;

    .line 56
    .local v1, "cachedModel":Lcom/brixd/niceapp/community/model/CommunityAppModel;
    if-eqz v1, :cond_38

    .line 58
    new-instance v2, Landroid/content/Intent;

    iget-object v3, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mContext:Landroid/content/Context;

    const-class v4, Lcom/brixd/niceapp/community/activity/CommunityDetailActivity;

    invoke-direct {v2, v3, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 59
    .local v2, "intent":Landroid/content/Intent;
    const-string v3, "AppModel"

    invoke-virtual {v2, v3, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/io/Serializable;)Landroid/content/Intent;

    .line 60
    const-string v3, "ScrollToUpUsers"

    iget-boolean v4, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mScrollToUpUsers:Z

    invoke-virtual {v2, v3, v4}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    .line 61
    const-string v3, "ScrollToComment"

    iget-boolean v4, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mScrollToComment:Z

    invoke-virtual {v2, v3, v4}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    .line 63
    iget-object v3, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mContext:Landroid/content/Context;

    if-eqz v3, :cond_37

    .line 64
    iget-object v3, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mContext:Landroid/content/Context;

    invoke-virtual {v3, v2}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    .line 97
    .end local v1    # "cachedModel":Lcom/brixd/niceapp/community/model/CommunityAppModel;
    .end local v2    # "intent":Landroid/content/Intent;
    :cond_37
    :goto_37
    return-void

    .line 70
    :cond_38
    iget-object v3, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mContext:Landroid/content/Context;

    const-string v4, ""

    const v5, 0x7f040003

    const/4 v6, 0x1

    const/4 v7, 0x0

    invoke-static {v3, v4, v5, v6, v7}, Lcom/zuiapps/suite/utils/hud/ProgressHUD;->show(Landroid/content/Context;Ljava/lang/CharSequence;IZLandroid/content/DialogInterface$OnCancelListener;)Lcom/zuiapps/suite/utils/hud/ProgressHUD;

    move-result-object v3

    iput-object v3, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mProgressHUD:Lcom/zuiapps/suite/utils/hud/ProgressHUD;

    .line 71
    iget-object v3, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mProgressHUD:Lcom/zuiapps/suite/utils/hud/ProgressHUD;

    const/4 v4, 0x0

    invoke-virtual {v3, v4}, Lcom/zuiapps/suite/utils/hud/ProgressHUD;->setCanceledOnTouchOutside(Z)V

    .line 72
    iget-object v3, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mRequest:Lcom/brixd/niceapp/service/restful/NiceAppRestfulRequest;

    new-instance v4, Lcom/brixd/niceapp/util/CommunityDetailRequestCache$1;

    invoke-direct {v4, p0, p1}, Lcom/brixd/niceapp/util/CommunityDetailRequestCache$1;-><init>(Lcom/brixd/niceapp/util/CommunityDetailRequestCache;I)V

    invoke-interface {v3, p1, v4}, Lcom/brixd/niceapp/service/restful/NiceAppRestfulRequest;->queryCommunityDetail(ILretrofit/Callback;)V

    goto :goto_37
.end method

.method public setScrollToUpUsers(Z)V
    .registers 3
    .param p1, "scrollToUpUsers"    # Z

    .prologue
    .line 39
    iput-boolean p1, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mScrollToUpUsers:Z

    .line 40
    iget-boolean v0, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mScrollToUpUsers:Z

    if-eqz v0, :cond_9

    .line 41
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mScrollToComment:Z

    .line 43
    :cond_9
    return-void
.end method

.method public setSctollToComment(Z)V
    .registers 3
    .param p1, "scrollToComment"    # Z

    .prologue
    .line 46
    iput-boolean p1, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mScrollToComment:Z

    .line 47
    iget-boolean v0, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mScrollToComment:Z

    if-eqz v0, :cond_9

    .line 48
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/brixd/niceapp/util/CommunityDetailRequestCache;->mScrollToUpUsers:Z

    .line 50
    :cond_9
    return-void
.end method
